package com.zksk.mbg.admin.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.zksk.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Insert;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 客户
 * </p>
 *
 * @author Zksk Acmen
 * @since 2022-12-02
 */
@Data
@Accessors(chain = true)
@TableName("platform_customer")
@ApiModel(value = "Customer对象", description = "客户")
public class Customer extends BaseEntity {

    @ApiModelProperty("客户表主键")
    @TableId(value = "customer_id", type = IdType.ASSIGN_ID)
    private Long customerId;

    @ApiModelProperty("客户（平台）名称")
    @TableField("customer_name")
    private String customerName;

    @ApiModelProperty("客户（平台）编码")
    @TableField("customer_code")
    private String customerCode;

    @ApiModelProperty("区域编码")
    @NotNull(message = "请选择区域!",groups = Insert.class)
    @TableField("area_code")
    private Long areaCode;

    @ApiModelProperty("区域名称（组合名称）")
    @NotNull(message = "请选择区域!",groups = Insert.class)
    @TableField("merger_name")
    private String mergerName;

    @ApiModelProperty("客户类型")
    @TableField("customer_type")
    private String customerType;

    @ApiModelProperty("联系人")
    @TableField("contacts")
    private String contacts;

    @ApiModelProperty("联系人电话")
    @TableField("contacts_phone")
    private String contactsPhone;

    @ApiModelProperty("是否对接（0对接 1未对接）")
    @TableField("handover")
    private Integer handover;

    @ApiModelProperty("客户状态（0上线 1未上线）")
    @TableField("`status`")
    private Integer status;

    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @ApiModelProperty("0存在 2删除")
    @TableLogic
    private Integer delFlag;


    public static final String CUSTOMER_ID = "customer_id";

    public static final String CUSTOMER_NAME = "customer_name";

    public static final String CUSTOMER_CODE = "customer_code";

    public static final String REGION_ID = "area_code";

    public static final String REGION_NAME = "merger_name";

    public static final String CUSTOMER_TYPE = "customer_type";

    public static final String CONTACTS = "contacts";

    public static final String CONTACTS_PHONE = "contacts_phone";

    public static final String HANDOVER = "handover";

    public static final String STATUS = "status";

    public static final String DEL_FLAG = "del_flag";

    @Override
    public Serializable pkVal() {
        return this.customerId;
    }

}
